void main() {
  Person p = Person("小张", 24, "女");
  Person p1 = Person("老高", 35, "男");
  p.say();
  p1.say();
}

class Person {
  String? name;
  int? age;
  String? sex;

  // 构造函数 两种写法 简写  一种完整写法
  // 构造函数名称和类名一样
  // Person(String? name, int? age, String? sex) {
  //   this.age = age;
  //   this.name = name;
  //   this.sex = sex;
  // }
  // 简写的写法
  Person(this.name, this.age, this.sex);

  say() {
    print('我是$name,今年$age,我是$sex');
  }
}
